package com.boss.salary.service;

import com.boss.common.entity.PageDTO;
import com.boss.framework.dto.PaginationDTO;
import com.boss.framework.exception.AppRuntimeException;
import com.boss.salary.entity.AgencyVerify;
import com.boss.salary.entity.SalaryMonthEnd;
import com.boss.salary.entity.SalaryRental;
import com.boss.sys.ca.user.dto.UserDTO;
import com.singularsys.jep.JepException;

import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface ISalaryHistoryService {

    /**
     * 月结操作
     */
    Map<String,String> saveMonthEnd(Integer year, String province, List<AgencyVerify> agencyVerifyLists) throws InvocationTargetException, IllegalAccessException, ParseException, NoSuchMethodException, JepException;

//    @Async
//    void saveMonthEndAsynchronous(Integer year, String province, List<String> agencyIds, Map<String, String> monthMap, Map<String, String> agencyNameMap, Map<String, String> agencyCodeMap, List<Object[]> personOperateUpdateList, String uuid) throws ParseException, InvocationTargetException, IllegalAccessException, NoSuchMethodException, JepException;
//
//    @Transactional(rollbackFor = Exception.class)
//    void saveMonthEnds(Integer year, String province, String agencyId, Map<String, String> monthMap, Map<String, String> agencyNameMap, Map<String, String> agencyCodeMap,List<Object[]> personOperateUpdateList,StringBuffer requestMessage) throws ParseException, InvocationTargetException, IllegalAccessException, NoSuchMethodException, JepException;


    /**
     * 撤销月结前校验
     * @param agencyIds
     * @param salaryMonth
     * @return
     */
    Map<String, Object> checkRevokeMonthEnd(List<String> agencyIds, String salaryMonth);

    /**
     * 撤销月结
     * @param salaryMonthEnd
     * @return
     */
    void revokeMonthEnd(SalaryMonthEnd salaryMonthEnd);

    /**
     * 获得应发工资  实发工资分页
     *
     * @param queryParam
     * @return
     */
    PageDTO<SalaryRental> getSalary(UserDTO userDTO, PaginationDTO paginationDTO, Map<String, Object> queryParam,List<String> childrenId) throws AppRuntimeException;

    /**
     * 获取未月结的数据-分页
     *
     * @param queryParam
     * @return
     */
    PageDTO<SalaryRental> getSalaryMonthEndPage(PaginationDTO paginationDTO,Map<String, Object> queryParam, List<String> childrenIds);

    /**
     * 获取月结的数据-分页
     *
     * @param queryParam
     * @return
     */
    PageDTO<SalaryRental> getSalaryMonthHistoryPage(PaginationDTO paginationDTO,Map<String, Object> queryParam, List<String> childrenIds);

    /**
     * 十三月工资：条件查询列表
     *
     * @param
     * @param agencyId
     * @param salaryMonth
     * @param salaryItem    工资项字段名
     * @return
     */
    List<Map<String, Object>> getSalaryHistoryPage(String agencyId,
                                 String salaryMonth,
                                 List<String> salaryItem,String mofDivCode);

    /**
     * 未月结导出查询
     * @param queryParam
     * @param childrenIds
     * @return
     */
    List<SalaryRental> getSalaryMonth(Map<String, Object> queryParam, List<String> childrenIds);

    /**
     * 已月结导出查询
     * @param queryParam
     * @param childrenIds
     * @return
     */
    List<SalaryRental> getSalaryMonthHistory(Map<String, Object> queryParam, List<String> childrenIds);
}
